<template>
    <div class="dialog-window" v-if="isShow">
      <div class="wrap">
        <div class="content" v-text="content"></div>
        <div class="divider"></div>
        <div class="btns">
          <div class="btns-close" @click="onCloseClick" v-if="showbtncode == 1">确认</div>
          <div class="btn-choose" v-if="showbtncode == 2">
              <div @click="onCancleClick">取消</div>
              <div class="line"></div>
              <div @click="onSureClick">确认</div>
          </div>
        </div>
      </div>
    </div>
</template>
<style scoped>
  .dialog-window{
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, .5);
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .wrap{
    width: 322px;
    height: 138px;
    background-color: #fff;
    border-radius: 16px;
    overflow: hidden;
  }
  .content{
    width: 322px;
    height: 96px;
    display: flex;
    text-align: center;
    font-family: PingFangSC-Regular;
    font-size: 16px;
    color: #555555;
    justify-content: center;
    align-items: center;
  }
  .divider{
    width: 322px;
    height: 2px;
    background: #DDDDDD;
  }
  .btns{
    width: 100%;
    height: 40px;
  }

  .btns-close{
    width: 100%;
    height: 40px;
    line-height: 40px;
    text-align: center;
    font-family: PingFangSC-Regular;
    font-size: 18px;
    color: #54CFB8;
  }
  .btn-choose{
    width: 100%;
    height: 40px;
    line-height: 40px;
  }

.btn-choose >div:nth-child(1){
    width: 49%;
    height: 40px;
    line-height: 40px;
    text-align: center;
    font-family: PingFangSC-Regular;
    font-size: 18px;
    color: #54CFB8;
    float: left;
  }
  .btn-choose >div:nth-child(3){
    width: 49%;
    height: 40px;
    line-height: 40px;
    text-align: center;
    font-family: PingFangSC-Regular;
    font-size: 18px;
    color: #54CFB8;
    float: right;
  }
  .line{
    width: 1px;
    height: 40px;
    background: #dddddd;
    float: left;
  }
</style>
<script>
export default {
  name: 'Dialog',
  data (){
    return {
        'isShow': true
    }
  },
  created () {
    window.hh = this;
      console.log(this)
  },
  props: ['content','showbtncode','onCloseClick','onCancleClick','onSureClick'],
    methods: {
        onCloseClickListner() {
            this.onCloseClick && this.onCloseClick();
        },
        onCancleClickListner() {
            this.onCancleClick && this.onCancleClick();
        },
        onSureClickListner() {
            this.onSureClick && this.onSureClick();
        }
    }
}
</script>

